/*
 * ============================================================================
 * Copyright Notice!
 * ----------------------------------------------------------------------------
 * This file contains proprietary and confidential information belonging to the
 * group of people involvled in developing this project.  Reproduction, disclosure 
 * or use without specific written authorization from project stake holders is 
 * prohibited. Please refer the readme.txt in project installation folder for more
 * specific contacts
 *
 * All rights reserved.
 * ============================================================================
 */
package edu.uwm.universitydb.model;

/**
 * Model representing a person in system <code>Person</type>
 * 
 * @author Shyam Nair
 */
public class Person implements Comparable<Person>
{
    /** attribute holding ssn number */
    private final String mSsnNum;

    /** attribute holding age */
    private final Integer mAge;

    /** attribute holding name */
    private final String mName;

    /**
     * 
     * @param ssnNum
     * @param age
     * @param name
     */
    public Person(final String ssnNum, final Integer age, final String name)
    {
        mSsnNum = ssnNum;
        mAge = age;
        mName = name;
    }

    /**
     * @return Returns the mSsnNum.
     */
    public String getSsnNum()
    {
        return mSsnNum;
    }

    /**
     * @return Returns the mAge.
     */
    public Integer getAge()
    {
        return mAge;
    }

    /**
     * @return Returns the mName.
     */
    public String getName()
    {
        return mName;
    }
    
	public String toString() {
		return mName;
	}
	
	public boolean equals(Object o) {
		return (o instanceof Person && ((Person)o).mSsnNum.equals(this.mSsnNum));
	}

	@Override
	public int compareTo(Person o) {
		return mName.compareTo(o.getName());
	}

}
/*
 * ============================================================================
 * Change History
 * ----------------------------------------------------------------------------
 * Apr 19, 2014   Shyam Nair
 * File created
 * ----------------------------------------------------------------------------
 * Apr 27, 2014   Jonathan Mitchell
 * Added Comparable interface for sorting people.
 * ----------------------------------------------------------------------------
 */